<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/27
 * Time: 18:46
 */

$id = $_GET['id'];

try
{
    $pdo = new PDO("mysql:host=127.0.0.1;dbname=test0925","root","");
    $pdo->exec("SET NAMES 'utf8'");
}
catch (Exception $e)
{
    var_dump($e);
    die("连接失败");
}

$res = $pdo->query("select * from zkw_user where  id = $id");

foreach ($res as $user){

?>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>注册</title>
        <link rel="stylesheet" type="text/css" href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.css">
    </head>
<body>
    <h1></h1>
<div class="header">
    <div class="am-g">
        <h1 style="text-align: center">大爷，请您修改</h1>
    </div>
    <hr />
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
    <form method="post" action="edit.php" class="am-form">
        <label for="name">姓名:</label>
        <input type="text" name="name" id="name" value="<?php echo $user['name'] ?>">
        <br>
        <label for="no">学号:</label>
        <input type="number" name="no" id="no" value="<?php echo $user['no'] ?>">
        <br>
        <label for="tel">电话:</label>
        <input type="tel" name="tel" id="tel" value="<?php echo $user['tel'] ?>">
        <br>
        <label for="age">年龄:</label>
        <input type="text" name="age" id="age" value="<?php echo $user['age'] ?>">
        <br>
        <label for="id">编号:</label>
        <input type="text" name="id" id="id" value="<?php echo $user['id'] ?>">
        <br>
        <br />
        <button type="submit" class="am-btn am-btn-secondary am-round">修　　改</button>
    </form>
    </div>
</div>
</body>
<?php } ?>